﻿#region Using Directives

    using System;
    using Csla;

#endregion

namespace MarketPulse.BusinessLogic.Private.Criteria
{
    /// <summary>
    /// Criteria class that allows a Survey to be uniquely identified.
    /// </summary>
    [Serializable]
    public class UniqueSurveyCriteria : CriteriaBase<UniqueSurveyCriteria>
    {

        /// <summary>
        /// This is the unique identifier used to identify all business objects within the system
        /// </summary>
        public static PropertyInfo<Guid> GuidProperty = RegisterProperty<Guid>(p => p.Guid);
        /// <summary>
        /// This is the unique identifier used to identify all business objects within the system
        /// </summary>
        public Guid Guid
        {
            get { return ReadProperty(GuidProperty); }
            private set { LoadProperty(GuidProperty, value); }
        }

        /// <summary>
        /// The Version ID of this survey.  When used in conjunction with a SurveyID, this
        /// uniquely identifies a given survey document.
        /// </summary>
        public static PropertyInfo<long> VersionIDProperty = RegisterProperty<long>(p => p.VersionID);
        /// <summary>
        /// The Version ID of this survey.  When used in conjunction with a SurveyID, this
        /// uniquely identifies a given survey document.
        /// </summary>
        public long VersionID
        {
            get { return ReadProperty(VersionIDProperty); }
            set { LoadProperty(VersionIDProperty, value); }
        }

        /// <summary>
        /// Creates a new instance of the object.
        /// </summary>
        /// <param name="guid">The unique identifier that identifies a Survey</param>
        /// <param name="versionId">The version number of the Survey</param>
        public UniqueSurveyCriteria(Guid guid, long versionID)
        {
            Guid = guid;
            VersionID = versionID;
        }

    }
}
